Skip to content

Expand curriculum RAG surface#16

Merged
smilebank7 merged 21 commits into
mainfrom
feat/rag-curriculum-surface
Jun 10, 2026
Merged

Expand curriculum RAG surface#16
smilebank7 merged 21 commits into
mainfrom
feat/rag-curriculum-surface

Conversation

@smilebank7

@smilebank7 smilebank7 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • normalize expanded RAG corpus generation so UI topic codes line up with local problem corpus records
  • add missing middle-school and common-math strategy YAML coverage
  • extend the web generation flow to carry school level through S1-S6 and send school_level to the agent
  • allow high common-math requests with nullable grade while keeping middle-school grade required

Notes

Verification

  • pnpm typecheck
  • pnpm test
  • pnpm -F @openmath/web build
  • pre-push hook: agent vitest 141 passed, math-engine pytest 20 passed
  • manual browser QA: high common-math selection → topic → intent URL/href verified; no console errors
  • RAG smoke: school_level=high, grade=null, topic=10공수01-01 returned refs

Summary by cubic

Expands the RAG surface to include high-school common math and fills middle-school gaps, aligning topic codes end-to-end. Threads school level through the web flow and agent, allowing nullable grade for high school.

  • New Features

    • RAG corpus: added builder to normalize AI Hub problems into JSONL; optional AI Hub 479 OCR corpus builder; summary reports git-ignored.
    • Curriculum data: added strategy YAML for high common-math (10공수*) and additional middle-school (9수*) topics; topic catalog now includes high common-math and “집합과 명제.”
    • Agent: grade is now nullable; middle-school still requires grade; school_level added to generate requests; generation-kind mapping extended for 10공수*.
    • Tests: coverage for high common-math lookup with grade=null, validation that middle requires grade, and expanded strategy loader (now 43 strategies).
    • Web app: added school param across S1–S6; grade picker supports “고등 공통수학”; labels and storage keys include school level; routes pass school and grade=common for high common; examples and copy updated.
    • Housekeeping: ignore local corpus summaries and .playwright-mcp/.
  • Migration

    • Optional: build local corpora with packages/agent/scripts/build-expanded-rag-corpus.py (OCR corpus build is optional).
    • Deep links: for high common-math flows, include school=high&grade=common in URLs.

Written for commit b3c81fc. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 53 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/web/app/app/new/export/view.tsx">

<violation number="1" location="packages/web/app/app/new/export/view.tsx:217">
P2: `useEffect` uses `schoolLevel` but omits it from dependencies, causing stale export data when school level changes.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

try {
const raw = window.sessionStorage.getItem(
storageKey(grade, topic, mode, dims, sourceProblemText),
storageKey(schoolLevel, grade, topic, mode, dims, sourceProblemText),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: useEffect uses schoolLevel but omits it from dependencies, causing stale export data when school level changes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/web/app/app/new/export/view.tsx, line 217:

<comment>`useEffect` uses `schoolLevel` but omits it from dependencies, causing stale export data when school level changes.</comment>

<file context>
@@ -204,10 +211,10 @@ export function ExportView({
     try {
       const raw = window.sessionStorage.getItem(
-        storageKey(grade, topic, mode, dims, sourceProblemText),
+        storageKey(schoolLevel, grade, topic, mode, dims, sourceProblemText),
       );
       if (raw === null) return;
</file context>

@smilebank7 smilebank7 changed the base branch from chore/gpt-55-xhigh-defaults to main June 10, 2026 00:39
smilebank7 and others added 21 commits June 10, 2026 09:40
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@smilebank7 smilebank7 force-pushed the feat/rag-curriculum-surface branch from 11587a8 to b3c81fc Compare June 10, 2026 00:40
@smilebank7 smilebank7 merged commit 71990cf into main Jun 10, 2026
4 checks passed
@smilebank7 smilebank7 deleted the feat/rag-curriculum-surface branch June 10, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant